import {myRequest} from "../../api/myRequest";
import { actionsMap } from '../../api/url'

const $RC = 'infConfig';
const $RC_actions = actionsMap[$RC]
const InfConfig ={
	/**
	 * 更新信息
	 * @param record
	 * @returns {Promise<*>}
	 */
	update(record) {
		return myRequest($RC,[{action: $RC_actions.UPDATE, data: [record]}]);
	},

	/**
	 * 查询列表
	 * @param
	 * @returns {Promise<*>}
	 */
	query(filter) {
		return myRequest($RC,[{action: $RC_actions.QUERY,...filter}]);
	},
	/**
	 * 新增
	 * @param
	 * @returns {Promise<*>}
	 */
	add(record) {
		return myRequest($RC,[{action: $RC_actions.ADD, data: [record]}]);
	},
	/**
	 * 删除
	 * @param
	 * @returns {Promise<*>}
	 */
	deleteByIds(ids) {
		return myRequest($RC,[{action: $RC_actions.DELETE_BY_IDS, ids}]);
	},
}

export default InfConfig;
